#include <iostream>
using namespace std;
int main()
{
    int m = 1, n, i = 1, sum = 0;
    while (cin >> n)
    {
        for (int i = 1; i <= n; i++)
        {
            m=m*i;
            sum+=m;
        }cout<<sum<<endl;
    }
}